{{include template('public/header','admin')}}
</head>
<body>
    <div class="container">
        <div style="margin: 20px;">
            <form class="form-horizontal" role="form" action="{{url($postUrl)}}" method="post"  id="cpform" name="cpform"  onsubmit="return dosub(this)" >
                <input type='hidden' name='id' value="{{$item['id']}}" />
                <div class="form-group">
                    <label for="tags" class="col-sm-2 control-label">{{L('tag_tag')}}</label>
                    <div class="col-sm-10 form-inline">
                        <textarea id="tags" name="tags" class="form-control" style="margin: 0px; width: 607px; height: 262px;"
                        datatype="*" nullmsg="{{L('tag_tag')}}不能为空" errormsg="{{L('tag_tag')}}不能为空"  placeholder="请输入{{L('tag_tag')}}"  
                        >{{$item['tag']}}</textarea>
                        <span class="help-block">*支持添加多个，每个tag之间请用逗号分隔</span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <input type='submit' name='dosubmit' class='btn  btn-default' value='{{L('submit')}}' />
                    </div>
                </div>
            </form>
        </div>
    </div>
    <script type="text/javascript">
        function dosub(obj) {
            if($("#tags").val()==''){
                 layer.msg("{{L('tag_tag')}}不能为空！");
                return false;
            }
            $.ajax({
                type: 'POST',
                url: '{{url($postUrl)}}',
                data: $(obj).serialize(),
                dataType: "json",
                success: function (ret) {
                    if (ret.status=="y") {
                        parent.location.reload();
                    } else {
                        layer.msg(ret.info);
                    }
                }
            });
            return false;
        }
    </script>
</body>
</html>